// 基于template/src/widgets/{{appEntities}}/{{ctrls@FORM}}-form/{{spinalCase ctrl.codeName}}-form-vo.ts.hbs生成
import { ControlVOBase } from '@/core';
import { transformValue } from '@/utils';
import { model } from './main-form-model';

export class FormControlVO extends ControlVOBase {
	constructor(data: any) {
		//  表单预置字段
		data.srfwfmemo = data['srfwfmemo'] ? data['srfwfmemo'] : '';
		data.srffrontuf = data['srffrontuf'] ? data['srffrontuf'] : '';
		super(data);
		//  表单自持属性
		this.$ownKeys = [
			'srfupdatedate',
			'srforikey',
			'srfkey',
			'srfmajortext',
			'srftempmode',
			'srfuf',
			'srfdeid',
			'srfsourcekey',
			'id',
			'name',
			'predef_type',
			'open_type',
			'disabled',
			'access_key',
			'secret_key',
			'redirect_uri',
			'agent_id',
			'region_id',
			'grant_types',
			'dc_default',
			'access_token',
			'expires_time',
			'description',
			'update_time',
		];
	}
	get srfupdatedate() {
		return this.$DO.update_time;
	}
	set srfupdatedate(value: any) {
		this.$DO.update_time = value;
	}
	get srfkey() {
		return this.$DO.id;
	}
	set srfkey(value: any) {
		this.$DO.id = value;
	}
	get srfmajortext() {
		return this.$DO.name;
	}
	set srfmajortext(value: any) {
		this.$DO.name = value;
	}
	get id() {
		return this.$DO.id;
	}
	set id(value: any) {
		this.$DO.id = value;
	}
	get name() {
		return this.$DO.name;
	}
	set name(value: any) {
		this.$DO.name = value;
	}
	get predef_type() {
		return this.$DO.predef_type;
	}
	set predef_type(value: any) {
		this.$DO.predef_type = value;
	}
	get open_type() {
		return this.$DO.open_type;
	}
	set open_type(value: any) {
		this.$DO.open_type = value;
	}
	get disabled() {
		return this.$DO.disabled;
	}
	set disabled(value: any) {
		this.$DO.disabled = value;
	}
	get access_key() {
		return this.$DO.access_key;
	}
	set access_key(value: any) {
		this.$DO.access_key = value;
	}
	get secret_key() {
		return this.$DO.secret_key;
	}
	set secret_key(value: any) {
		this.$DO.secret_key = value;
	}
	get redirect_uri() {
		return this.$DO.redirect_uri;
	}
	set redirect_uri(value: any) {
		this.$DO.redirect_uri = value;
	}
	get agent_id() {
		return this.$DO.agent_id;
	}
	set agent_id(value: any) {
		this.$DO.agent_id = value;
	}
	get region_id() {
		return this.$DO.region_id;
	}
	set region_id(value: any) {
		this.$DO.region_id = value;
	}
	get grant_types() {
		return this.$DO.grant_types;
	}
	set grant_types(value: any) {
		this.$DO.grant_types = value;
	}
	get dc_default() {
		return this.$DO.dc_default;
	}
	set dc_default(value: any) {
		this.$DO.dc_default = value;
	}
	get access_token() {
		return this.$DO.access_token;
	}
	set access_token(value: any) {
		this.$DO.access_token = value;
	}
	get expires_time() {
		return this.$DO.expires_time;
	}
	set expires_time(value: any) {
		this.$DO.expires_time = value;
	}
	get description() {
		return this.$DO.description;
	}
	set description(value: any) {
		this.$DO.description = value;
	}
	get update_time() {
		return this.$DO.update_time;
	}
	set update_time(value: any) {
		this.$DO.update_time = value;
	}
	// 界面主键标识
	get open_access() {
		return this.$DO.id;
	}

	set open_access(value: any) {
		this.$DO.id = value;
	}

	//  工作流预置字段
	srfwfmemo: any;
	srffrontuf: any;

	//  无实体属性表单项
	get srftempmode() {
		return this.$DO.srftempmode;
	}

	set srftempmode(value: any) {
		this.$DO.srftempmode = value;
	}

	//  表单重复器

	/**
	 * 返回后台数据
	 *
	 * @return {*}
	 * @memberof FormControlVO
	 */
	public getDo() {
		return {
			srffrontuf: this.srffrontuf,
			id: this.$DO.id,
			name: this.$DO.name,
			predef_type: this.$DO.predef_type,
			open_type: this.$DO.open_type,
			disabled: this.$DO.disabled,
			access_key: this.$DO.access_key,
			secret_key: this.$DO.secret_key,
			redirect_uri: this.$DO.redirect_uri,
			agent_id: this.$DO.agent_id,
			region_id: this.$DO.region_id,
			grant_types: this.$DO.grant_types,
			dc_default: this.$DO.dc_default,
			access_token: this.$DO.access_token,
			expires_time: this.$DO.expires_time,
			description: this.$DO.description,
			update_time: this.$DO.update_time,
		};
	}
}
